{% extends "forum_base.html" %}  {% import "macro/display.html" as display %}
{% block title %}{{ thread.title|escape }} ({{ forum.title|e }}){% endblock %}

{% block pagetitle %}{{ forum.title|e }} &raquo; {{ thread.title|escape }}{% endblock %}


{% block breadcrumbs %}{% for title, url in thread.forum.get_url_name() %} &raquo; <a href='{{ url }}'>{{ title|e }}</a>{% endfor %} &raquo; <a href='{{ thread.get_absolute_url() }}'>{{ thread.title|escape }}</a> ({{ thread.posts }} post{{ thread.posts|pluralize }}){% endblock %}

{% block forumcontent %}

{{ display.onelinerlink("thread", thread.id, user) }}

<div class="pages">Pages: {% for p in page_range %}
{% if page == p %}<b>{{ p }}</b>{% else %}<a href="/forum/thread/{{ thread.id }}/?page={{ p }}">{{ p }}</a> {% endif %}
{% endfor %}
</div>

<table id='djangoForumThreadPosts'>
<tr>
    <th>Author</th>
    <th>Thread</th>
</tr>

{% for post in posts %}
<tr class='postmain'>
    <td class='djangoForumThreadPostDetail' id='post{{ post.id }}'>
        {% set U = post.author %}{% include "webview/t/user.html" %}<br />
        {% if post.author.get_profile().avatar %}
        <img src="{{ post.author.get_profile().avatar.url }}" alt="avatar"/><br />
        {% endif %}
        {{ post.author.get_profile().infoline }}<br />
        {% set U = post.author %}{% include "webview/t/user-icons.html" %}<br />
        {{ dv.j_get_post_count(post.author) }} Posts<br />
        <a href="{{ post.get_absolute_url() }}">#{{ post.id }}</a> <span>({{ post.time|timesince }} ago)</span><br />
    </td>
    <td class="post"><div>{# {% cache 600 "forumpost" post.id post.edited %} #}
        {{ post.body|mksafe|linebreaksbr|bbcode|smileys }}
    {# {% endcache %} #}</div></td>
</tr>
<tr class='postfooter'>
    <td></td>
    <td>
        {% if user == post.author %}<a href="/forum/edit/{{ post.id }}/"><i>Edit Post</i></a>{% endif %}
        <span>Quote</span>
    </td>
</tr>
{% endfor %}

</table>

<div class="pagesBottom">Pages: {% for p in page_range %}
{% if page == p %}<b>{{ p }}</b>{% else %}<a href="/forum/thread/{{ thread.id }}/?page={{ p }}">{{ p }}</a> {% endif %}
{% endfor %}
</div>

{% if user.is_authenticated() %}<h2><a href="{{ url("forum_subscriptions") }}">Manage Your Subscriptions</a></h2>{% endif %}
<h2>Post a Reply</h2>
{% if thread.closed %}
<p>Sorry, this thread is closed. No further comments are permitted.</p>
{% else %}
{% if user.is_authenticated() %}
<form method='post' action='.'>
<p><label>Posting As</label> <span>{{ user.username }}</span></p>
<p> {{ reply_form.body.label_tag() }}
{{ reply_form.body }}
{{ reply_form.body.errors }}</p>
<p>{{ reply_form.subscribe.label_tag() }}
{{ reply_form.subscribe }}
{{ reply_form.subscribe.errors }}</p>
<input type='submit' value='Submit' />
</form>
{% else %}
<p>Please log in to post a reply.</p>
{% endif %}
{% endif %}

{% endblock %}

